package march.test_3_27;

import java.util.Scanner;

public class TestMain1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()) {
            int n = scanner.nextInt();
            String a = scanner.nextLine();
            String[] strings = new String[n];
            for(int i = 0; i < n; i++) {
                String str = scanner.nextLine();
                strings[i] = result(str);
            }
            for(int i = 0; i < n; i++) {
                System.out.print(strings[i]);
                if(i != n-1) {
                    System.out.print(",");
                }
            }
            System.out.println();
        }
    }
    public static String result(String str) {
        for(int i = 0; i < str.length(); i++) {
            if(str.charAt(i) == ',') {
                return "\"" + str + "\"";
            }
        }
        return str;
    }
}
